package com.zmn.plat.admin.controller.part.category.map;

import java.util.List;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.zmn.common.dto.LayuiTableResponseDTO;
import com.zmn.plat.admin.controller.part.PartBaseController;
import com.zmn.plat.model.entity.part.PartCategoryMapQuery;
import com.zmn.plat.model.vo.part.PartCategoryMapVO;

/**
 * 类描述： PartCategoryMapAjaxController 产品配件分类关联 异步加载控制器
 *
 * @author DaiZhichao
 * @since 2018/12/13 16:46
 */
@RestController
@RequestMapping("/part/category/map/ajax")
public class PartCategoryMapAjaxController extends PartBaseController {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    /**
     * 描述: [Layui] 加载数据表格
     *
     * @author DaiZhichao
     * @since 2018/11/6 20:54
     */
    @SuppressWarnings("Duplicates")
    @RequestMapping(value = "/list", produces = "application/json; charset=utf-8")
    @RequiresPermissions("/part/category/map/list.action")
    public LayuiTableResponseDTO partCategoryMapList(PartCategoryMapQuery query) {

        List<PartCategoryMapVO> partCategoryMapVOList = partCategoryMapService.listVOPageByQuery(query);

        return LayuiTableResponseDTO.success(query.getTotalCount(), partCategoryMapVOList);
    }

}
